home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nikkei Mac 20
/
NIKKEI-MAC-CD-VOL-20-1998-12.ISO.7z
/
NIKKEI-MAC-CD-VOL-20-1998-12.ISO
/
オンラインソフト
/
5.文書作成支援
/
UltraFind
/
UltraFind 2.5.3 Full Pack.sit
/
UltraFind 2.5.3 Full Package
/
AppleScript™ Examples
/
UF Find Untitled
< prev
next >
Wrap
Text File
|
1997-06-21
|
2KB
|
62 lines
tell application "UltraFind 2.5.3"
clear
set the text of fileName of its searchRoutine to "untitled"
set the searchType of fileName of its searchRoutine to nameContains
set the fileKind of its searchRoutine to filesAndFolders
scan
end tell
copy the result to numFiles
if numFiles is greater than 0 then
set dialogtext to "Found " & (numFiles as text) & " untitled files : " & return & return
set fileNum to 1
repeat until fileNum is greater than numFiles
tell application "UltraFind 2.5.3"
copy (the name of fileRecord fileNum) to fName
copy (the fileKind of fileRecord fileNum) to fKind
end tell
-- The Display Dialog routine cannot more than 255 characters so...
set addText to (fileNum as text) & ". " & fKind & " メ" & fName & "モ" & return
if (length of addText) + (length of dialogtext) is less than 190 then
set dialogtext to dialogtext & addText
else
set dialogtext to dialogtext & return & "(..and more..)" & return
set fileNum to numFiles
end if
set fileNum to fileNum + 1
end repeat
set dialogtext to dialogtext & return & "Do you want to trash these files?"
if the button returned of (display dialog dialogtext buttons {"Yes", "No"} default button "No") is "Yes" then
set myWasteBasket to ("Galileo:Trash" as alias)
repeat with fileNum from 1 to numFiles
tell application "UltraFind 2.5.3"
copy (the accessPath of fileRecord fileNum) to fName
end tell
set aliasList to (fName as alias) as list
tell application "Finder"
-- NOTE If using Finder 7.1.2 this may need modifying
move to myWasteBasket --from aliasList -- NOTE: un-comment for use with Finder 7.1.2
end tell
end repeat
set dialogtext to (numFiles as text) & " items were trashed!" & return & return ツ
& "Do you want me to empty the wastebasket now?"
if the button returned of (display dialog dialogtext buttons {"Yes", "No"} default button "No") is "Yes" then
tell application "Finder"
empty trash
end tell
end if
end if
end if
tell application "UltraFind 2.5.3" to quit